<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#box{
				width: 200px;
				height: 200px;
				background-color: red;
			}
		</style>
	</head>
	<body>
		<div id="box">box</div>
	</body>
</html>
<script>
	
	// 一个元素默认背景颜色为红色，点击元素交替变红变黄？
	
	let oBox = document.getElementById('box');
	
	oBox.onclick = function(){
		oBox.style.backgroundColor = 'yellow';
	}
	
</script>